package com.example.yt_app.Interface;

import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.Response;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Query;
import retrofit2.http.Url;

/**
 * Created by dell on 2021/7/12.
 */
@SuppressWarnings("ALL")
public interface HttpbinService {
    //http://www.httbin.org./post
    @SuppressWarnings({"AlibabaAbstractMethodOrInterfaceMethodMustUseJavadoc", "AlibabaCommentsMustBeJavadocFormat"})
    @POST("post")
    @FormUrlEncoded
    Call<ResponseBody> post(@Field("userName") String userName , @Field("passsword") String pwd);
    @SuppressWarnings({"AlibabaAbstractMethodOrInterfaceMethodMustUseJavadoc", "AlibabaCommentsMustBeJavadocFormat"})
    @GET("get")
    //http://www.httbin.org./get
    Call<Response> get(@Header("api-key") String userName , @Query("datastream_ids=") String pwd);
    //表单
    @SuppressWarnings({"AlibabaAbstractMethodOrInterfaceMethodMustUseJavadoc", "AlibabaCommentsMustBeJavadocFormat"})
    @POST("post")
    Response<ResponseBody> postBody(@Body RequestBody body);
    /*添加头部*/
    @SuppressWarnings({"AlibabaAbstractMethodOrInterfaceMethodMustUseJavadoc", "AlibabaCommentsMustBeJavadocFormat"})
    @Headers({"os:android","version:1.0"})
    @POST("post")
    Call<ResponseBody> postwithHeaders();
    /*写入链接*/
    @SuppressWarnings({"AlibabaAbstractMethodOrInterfaceMethodMustUseJavadoc", "AlibabaCommentsMustBeJavadocFormat"})
    @POST
    Call<ResponseBody> postUrl(@Url String url);

}
